﻿<%@ Page Title="" Language="C#" MasterPageFile="~/backend/Admin.Master" AutoEventWireup="true" CodeBehind="ContactList.aspx.cs" Inherits="mamnontuoitho7.backend.ContactList" %>
<asp:Content ID="Content1" ContentPlaceHolderID="AdminTitleContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<!-- Begin one column tab content window -->
    <div class="onecolumn">
	    <div class="header">
		    <span>Danh Sách Tin Liên Hệ - Góp Ý</span>
	    </div>
	    <br class="clear"/>
	    <div class="content">
		    <div id="tab1_content" class="tab_content">
			    <table width="100%">
                    <tr>
                        <td>
                            <!--<div id="content">-->
                            <div id="tablewrapper">
                                <div id="tableheader">
                                    <div class="search">
                                        <select id="columns" onchange="sorter.search('query')">
                                        </select>
                                        <input type="text" id="query" onkeyup="sorter.search('query')" />
                                    </div>
                                    <div class="details">
                                        <div class="ddl">
                                        </div>
                                        <div>
                                            <asp:Label ID="Label20" runat="server" Text='Kết quả' />
                                            <span id="startrecord"></span>-<span id="endrecord"></span>
                                            <asp:Label ID="Label21" runat="server" Text='của' />
                                            <span id="totalrecords"></span>
                                        </div>
                                        <div>
                                            <a href="javascript:sorter.reset()">
                                                <asp:Label ID="Label23" runat="server" Text='Thiết lập lại' /></a></div>
                                    </div>
                                </div>
                                <table cellpadding="0" cellspacing="0" border="0" id="table" class="tinytable">
                                    <thead>
                                        <tr>
                                            <!--vị trí header list-->
                                            <th>
                                                <h3>
                                                    <asp:Label ID="Label1" runat="server" Text='Ngày'></asp:Label></h3>
                                            </th>
                                            <th>
                                                <h3>
                                                    <asp:Label ID="Label5" runat="server" Text='Họ Tên'></asp:Label></h3>
                                            </th>
                                            <th>
                                                <h3>
                                                    <asp:Label ID="Label6" runat="server" Text='Email'></asp:Label></h3>
                                            </th>
                                            <th>
                                                <h3>
                                                    <asp:Label ID="Label90" runat="server" Text='Số Phone'></asp:Label></h3>
                                            </th>
                                            <th>
                                                <h3>
                                                    <asp:Label ID="Label2" runat="server" Text='Nội dung liên hệ - góp ý'></asp:Label></h3>
                                            </th>
                                            <th >
                                                <h3>
                                                    <asp:Label ID="Label27" runat="server" Text='Tình trạng' /></h3>
                                            </th>
                                            <th class="nosort" style="text-align: center;">
                                                <h3>
                                                    <asp:Label ID="Label22" runat="server" Text='Xóa' /></h3>
                                            </th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <!--vị trí content list-->
                                        <%
                                            /* write code get datatable show into for loop */
                                            for (int i = 0; i < _dt.Rows.Count; i++)
                                            {
                                        %>
                                        <tr>
                                            <td  style="text-align:center; width:80px">
                                                <%= DateTime.Parse(_dt.Rows[i]["CreateDate"].ToString()).ToString("dd/MM/yyyy")%>
                                            </td>
                                            <td>
                                                <%=_dt.Rows[i]["FullName"].ToString()%>
                                            </td>
                                            <td>
                                                <%=_dt.Rows[i]["Email"].ToString()%>
                                            </td>
                                            <td style="width:80px">
                                                <%=_dt.Rows[i]["Phone"].ToString()%>
                                            </td>
                                            <td>
                                                <%=_general.ReplaceSpecialCharacters( _dt.Rows[i]["Content"].ToString())%>
                                            </td>
                                            <td style="width: 70px;text-align:center;">
                                                <%string a = _dt.Rows[i]["IsAnswer"].ToString();
                                                  if (_dt.Rows[i]["IsAnswer"].ToString().Equals("True"))
                                                  { %>
                                                  <img alt="" src="layout/table/images/activation.png" title="Đã trả lời"/>
                                                    <% }
                                                  else
                                                  { %>
                                                     <form method="post" action="ContactList.aspx">
                                                       <input type="hidden" id="hidContactID" name="hidContactID" value="<%=_dt.Rows[i]["ContactID"].ToString()%>" />
                                                       <button type="submit" title="Chưa trả lời"><img alt="" src="layout/table/images/inactivation.png" /></button>
                                                     </form>
                                                    
                                                    <% } %>
                                            </td>
                                            <td style="width: 60px; text-align: center;">
                                                <%--<a href="javascript: if (confirm('Bạn có muốn xóa?')) { window.location.href='#' } else { void('') }; ">
                                                    <img alt="Xóa" src="layout/table/images/delete.png" /></a>--%>
                                                 <form method="post" action="ContactList.aspx">
                                                   <input type="hidden" id="Hidden2" name="hidContactIDDelete" value="<%=_dt.Rows[i]["ContactID"].ToString()%>" />
                                                   <button type="submit" title="Xóa bản tin" onclick="javascript: if (confirm('Bạn muốn xóa liên hệ này?')) { window.location.href='#' } else { return false; };"><img alt="" src="layout/table/images/delete.png" /></button>
                                                 </form>
                                            </td>
                                        </tr>
                                        <% } %>
                                    </tbody>
                                </table>
                                <div id="tablefooter">
                                    <div id="tablenav">
                                        <div>
                                            <img src="layout/table/images/first.gif" alt=""/>
                                            <img src="layout/table/images/first.gif" width="16" height="16" alt="First Page"
                                                onclick="sorter.move(-1,true)" />
                                            <img src="layout/table/images/previous.gif" width="16" height="16" alt="First Page"
                                                onclick="sorter.move(-1)" />
                                            <img src="layout/table/images/next.gif" width="16" height="16" alt="First Page" onclick="sorter.move(1)" />
                                            <img src="layout/table/images/last.gif" width="16" height="16" alt="Last Page" onclick="sorter.move(1,true)" />
                                        </div>
                                        <div>
                                            <select id="pagedropdown">
                                            </select>
                                        </div>
                                        <div>
                                            <a href="javascript:sorter.showall()">
                                                <asp:Label ID="Label25" runat="server" Text='Xem tất cả' /></a>
                                        </div>
                                    </div>
                                    <div id="tablelocation">
                                        <div>
                                            <select onchange="sorter.size(this.value)">
                                                <option value="5">5</option>
                                                <option value="10" selected="selected">10</option>
                                                <option value="20">20</option>
                                                <option value="50">50</option>
                                                <option value="100">100</option>
                                            </select>
                                            <span>
                                                <asp:Label ID="Label24" runat="server" Text='Kết quả mỗi trang' /></span>
                                        </div>
                                        <div class="page">
                                            <asp:Label ID="Label55" runat="server" Text='Trang' />
                                            <span id="currentpage"></span>
                                            <asp:Label ID="Label26" runat="server" Text='của' />
                                            <span id="totalpages"></span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <script type="text/javascript" src="layout/table/1.js"></script> <!--vị trí có tham số không sort trên grid đếm từ phải qua trái-->
                            <script type="text/javascript">
                                var sorter = new TINY.table.sorter('sorter', 'table', {
                                    headclass: 'head',
                                    ascclass: 'asc',
                                    descclass: 'desc',
                                    evenclass: 'evenrow',
                                    oddclass: 'oddrow',
                                    evenselclass: 'evenselected',
                                    oddselclass: 'oddselected',
                                    paginate: true,
                                    size: 10,
                                    colddid: 'columns',
                                    currentid: 'currentpage',
                                    totalid: 'totalpages',
                                    startingrecid: 'startrecord',
                                    endingrecid: 'endrecord',
                                    totalrecid: 'totalrecords',
                                    hoverid: 'selectedrow',
                                    pageddid: 'pagedropdown',
                                    navid: 'tablenav',
                                    sortcolumn: 0,
                                    sortdir: -1,
                                    /* sum:[8],
                                    avg:[6,7,8,9],
                                    columns:[{index:7, format:'%', decimals:1},{index:8, format:'$', decimals:0}], */
                                    init: true
                                });
                            </script>
                            <!--</div>-->
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
<!-- End one column tab content window -->
</asp:Content>
